Trees | Index | Help |
|
---|
Package pydbg :: Module my_ctypes |
|
Author: Pedram Amini
Contact: pedram.amini@gmail.com
Organization: www.openrce.org
License: GNU General Public License 2.0 or later
Function Summary | |
---|---|
Mixed |
This routine is called by _reduce for unmarshaling purposes. |
Tuple |
cPickle will allow an object to marshal itself if the __reduce__ function is defined. |
Variable Summary | |
---|---|
tuple |
c_types = (<type '_ctypes.Structure'>, <class 'ctypes.c_...
|
Function Details |
---|
_construct(typ, raw_bytes)This routine is called by _reduce for unmarshaling purposes. The object type is used to instantiate a new object of the desired type. The raw bytes are then directly written into the address space of the newly instantiated object via the ctypes routines memmove() and addressof().
|
_reduce(self)cPickle will allow an object to marshal itself if the __reduce__ function is defined. Because cPickle is unable to handle ctype primitives or the objects derived on those primitives we define this function that later is assigned as the __reduce__ method for all types. This method relies on _construct for unmarshaling. As per the Python docs __reduce__ must return a tuple where the first element is "A callable object that will be called to create the initial version of the object. The next element of the tuple will provide arguments for this callable...". In this case we pass the object class and the raw data bytes of the object to _construct.
|
Variable Details |
---|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Jun 16 17:16:24 2006 | http://epydoc.sf.net |